package com.shiguiwu.springmybatis.spring.autowired.resource;

import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @description: a
 * @author: stone
 * @date: Created by 2021/3/15 15:25
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springmybatis.spring.autowired
 */
@Component
@Data
public class Ra implements Rc {

    private Rc rc;

    //用在方法
//    @Resource
    public void test(Rb rc) {
        System.out.println(this.getClass() + "：通过普通方法注入");
        this.rc = rc;

    }

    //指定名称
//    @Resource(name = "rb")
    public void test1(Rc rc) {
        System.out.println(this.getClass() + "：通过普通方法注入");
        this.rc = rc;
    }

    //用在参数上,不持之
    public void test2( Rc rc) {
        System.out.println(this.getClass() + "：通过普通方法注入");
        this.rc = rc;
    }
}
